<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: pub</title>
    
    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">
    
    <h1 class="page-title">Class: pub</h1>
    
    



<section>
    
<header>
    <h2>
        <span class="ancestors"><a href="module-easyrtc_public_obj.html">easyrtc_public_obj</a>~</span>
    
    pub
    </h2>
    
</header>  

<article>
    <div class="container-overview">
    
    
    
        
<dt>
    <h4 class="name" id="pub"><span class="type-signature"></span>new pub<span class="signature">()</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        The public object which is returned by the EasyRTC listen() function. Contains all public methods for interacting with EasyRTC server.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 24
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

    
    </div>
    
    
    
    
    
    
    
    
        <h3 class="subsection-title">Classes</h3>
        
        <dl>
            <dt><a href="module-easyrtc_public_obj-pub.events.html">events</a></dt>
            <dd></dd>
        
            <dt><a href="module-easyrtc_public_obj-pub.util.html">util</a></dt>
            <dd></dd>
        </dl>
    
    
    
    
    
    
    
        <h3 class="subsection-title">Methods</h3>
        
        <dl>
            
<dt>
    <h4 class="name" id="app"><span class="type-signature">&lt;static> </span>app<span class="signature">(appName, <span class="optional">callback</span>)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Contains the methods for interfacing with an EasyRTC application.The callback will receive an application object upon successful retrieval of application.The callback may receive an Error object if unsuccessful. Depending on the severity, known errors have an "instanceof" ApplicationWarning or ApplicationError.The function does return an application object which is useful for chaining, however the callback approach is safer and provides additional information in the event of an error.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Argument</th>
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>appName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="attributes">
                
                    
                
                    &lt;nullable><br>
                
                </td>
            
            
            
            
            <td class="description last">Application name which uniquely identifies it on the server. Uses default application if null.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="global.html#appCallback">appCallback</a></span>


            
            </td>
            
            
                <td class="attributes">
                
                    &lt;optional><br>
                
                    
                
                </td>
            
            
            
            
            <td class="description last">Callback with error and application object</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 1032
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="createApp"><span class="type-signature">&lt;static> </span>createApp<span class="signature">(appName, options, <span class="optional">callback</span>)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Creates a new EasyRTC application with default values. If a callback is provided, it will receive the new application object.The callback may receive an Error object if unsuccessful. Depending on the severity, known errors have an "instanceof" ApplicationWarning or ApplicationError.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Argument</th>
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>appName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="attributes">
                
                    
                
                </td>
            
            
            
            
            <td class="description last">Application name which uniquely identifies it on the server.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>options</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="attributes">
                
                    
                
                    &lt;nullable><br>
                
                </td>
            
            
            
            
            <td class="description last">Options object with options to apply to the application. May be null.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="global.html#appCallback">appCallback</a></span>


            
            </td>
            
            
                <td class="attributes">
                
                    &lt;optional><br>
                
                    
                
                </td>
            
            
            
            
            <td class="description last">Callback with error and application object</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 937
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="getAppNames"><span class="type-signature">&lt;static> </span>getAppNames<span class="signature">(callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends an array of all application names to a callback.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function(Error, Array.&lt;string>)</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback with error and array containing all application names.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 50
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="getAppWithEasyrtcid"><span class="type-signature">&lt;static> </span>getAppWithEasyrtcid<span class="signature">(easyrtcid, callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Gets app object for application which has an authenticated client with a given easyrtcid
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Unique identifier for an EasyRTC connection.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function(Error, Object)</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback with error and application object</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 65
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="getConnectionWithEasyrtcid"><span class="type-signature">&lt;static> </span>getConnectionWithEasyrtcid<span class="signature">(easyrtcid, callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Gets connection object for connection which has an authenticated client with a given easyrtcid
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
            
            
            
            <td class="description last">EasyRTC unique identifier for a socket connection.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function(Error, Object)</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback with error and connection object</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 83
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="getOption"><span class="type-signature">&lt;static> </span>getOption<span class="signature">(option)</span><span class="type-signature"> &rarr; {*}</span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Gets individual option value. The option value returned is for the server level.Note that some options can be set at the application or room level. If an option has not been set at the room level, it will check to see if it has been set at the application level, if not it will revert to the server level.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>option</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Option name</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 109
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Option value (can be any JSONable type)
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">*</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="getVersion"><span class="type-signature">&lt;static> </span>getVersion<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Gets EasyRTC Version. The format is in a major.minor.patch format with an optional letter following denoting alpha or beta status. The version is retrieved from the package.json file located in the EasyRTC project root folder.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 119
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    EasyRTC Version
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">string</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="isApp"><span class="type-signature">&lt;static> </span>isApp<span class="signature">(appName, callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determine if a given application name has been defined.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>appName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Application name which uniquely identifies it on the server.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function(Error, {boolean})</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback with error and boolean of whether application is defined.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 923
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="setOption"><span class="type-signature">&lt;static> </span>setOption<span class="signature">(option, value)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets individual option. The option value set is for the server level.Note that some options can be set at the application or room level. If an option has not been set at the room level, it will check to see if it has been set at the application level, if not it will revert to the server level.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>option</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Option name</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>value</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Option value</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="easyrtc_public_obj.js.html">easyrtc_public_obj.js</a>, line 144
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true on success, false on failure
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        </dl>
    
    
    
    
    
</article>

</section>  




</div>

<nav>
    <h2><a href="index.html">Index</a></h2><h3>Modules</h3><ul><li><a href="module-easyrtc_default_event_listeners.html">easyrtc_default_event_listeners</a></li><li><a href="module-easyrtc_public_obj.html">easyrtc_public_obj</a></li></ul><h3>Classes</h3><ul><li><a href="module-easyrtc_default_event_listeners-eventListener.html">eventListener</a></li><li><a href="module-easyrtc_public_obj-pub.html">pub</a></li><li><a href="module-easyrtc_public_obj-pub.events.html">events</a></li><li><a href="module-easyrtc_public_obj-pub.util.html">util</a></li><li><a href="pub.appObj.html">appObj</a></li><li><a href="pub.appObj.connectionObj.html">connectionObj</a></li><li><a href="pub.appObj.connectionObj.connectionRoomObj.html">connectionRoomObj</a></li><li><a href="pub.appObj.roomObj.html">roomObj</a></li><li><a href="pub.appObj.sessionObj.html">sessionObj</a></li></ul><h3>Global</h3><ul></ul>
</nav>

<br clear="both">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Wed Mar 05 2014 12:50:34 GMT-0800 (PST)
</footer>

<script> prettyPrint(); </script>
</body>
</html>
